# use third libs
include(FetchContent)

# concurrentqueue
message("Downlaod concurrentqueue from https://gitee.com/bt-server/concurrentqueue.git")
FetchContent_Declare(
  concurrentqueue
  GIT_REPOSITORY https://gitee.com/bt-server/concurrentqueue.git
  SOURCE_DIR ${THIRD_LIB}/concurrentqueue
  GIT_SHALLOW    TRUE # 不拉取完整历史，相当于`git clone --depth=1`
  )

FetchContent_GetProperties(concurrentqueue)
if (NOT concurrentqueue_POPULATED)
  FetchContent_Populate(concurrentqueue)
endif ()

macro(use_concurrentqueue ag_project_name)
  target_compile_definitions(${ag_project_name} PRIVATE USE_LIB_concurrentqueue)
  # include concurrentqueue_SOURCE_DIR ==> concurrentqueue
  target_include_directories(${ag_project_name} PRIVATE ${concurrentqueue_SOURCE_DIR})
endmacro(use_concurrentqueue)